home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / samba / patches / samba-1.026 / samba-1
Encoding:
Text File  |  1995-09-19  |  13.9 KB  |  420 lines

  1. diff -u -r --new-file last-version/docs/smb.conf.5 samba-1.9.14alpha19/docs/smb.conf.5
  2. --- last-version/docs/smb.conf.5    Thu Sep 14 09:57:46 1995
  3. +++ samba-1.9.14alpha19/docs/smb.conf.5    Sun Sep 17 10:28:23 1995
  4. @@ -779,8 +779,22 @@
  5.  
  6.  Typically the default service would be a public, read-only service.
  7.  
  8. +Also not that s of 1.9.14 the apparent service name will be changed to
  9. +equal that of the requested service, this is very useful as it allows
  10. +you to use macros like %S to make a wildcard service.
  11. +
  12. +Note also that any _ characters in the name of the service used in the
  13. +default service will get mapped to a /. This allows for interesting
  14. +things.
  15. +
  16. +
  17.  .B Example:
  18.       default service = pub
  19. +        
  20. +        [pub]
  21. +             path = /%S
  22. +          
  23. +
  24.  .SS deny hosts (S)
  25.  A synonym for this parameter is 'hosts deny'.
  26.  
  27. diff -u -r --new-file last-version/source/change-log samba-1.9.14alpha19/source/change-log
  28. --- last-version/source/change-log    Sat Sep 16 12:12:30 1995
  29. +++ samba-1.9.14alpha19/source/change-log    Wed Sep 20 00:33:10 1995
  30. @@ -1578,6 +1578,11 @@
  31.      - changed error return code from cannor chdir() in make_connection
  32.      - fixed realloc() bug in printing.c
  33.      - fixed invalid username bug in sesssetupX
  34. +    - released alpha18
  35. +    - made default service change name to asked for service (idea
  36. +    from Ian McEwan <ijm@doc.ic.ac.uk>)
  37. +    - fixed "guest only" bug
  38. +    - sambatar patches from Ricky
  39.  
  40.  
  41.  ==========
  42. diff -u -r --new-file last-version/source/client.c samba-1.9.14alpha19/source/client.c
  43. --- last-version/source/client.c    Fri Sep 15 21:05:13 1995
  44. +++ samba-1.9.14alpha19/source/client.c    Sun Sep 17 09:55:11 1995
  45. @@ -3692,13 +3692,14 @@
  46.        exit(1);
  47.      }
  48.  
  49. +/*
  50.        if (count_chars(service,'\\') > 3)
  51.      {
  52.        usage(pname);
  53.        printf("\n%s: Too many '\\' characters in service\n",service);
  54.        exit(1);
  55.      }
  56. -  
  57. +    */
  58.  
  59.        if (argc > 1 && (*argv[1] != '-'))
  60.      {
  61. diff -u -r --new-file last-version/source/clitar.c samba-1.9.14alpha19/source/clitar.c
  62. --- last-version/source/clitar.c    Fri Sep 15 20:24:05 1995
  63. +++ samba-1.9.14alpha19/source/clitar.c    Wed Sep 20 00:30:15 1995
  64. @@ -2,7 +2,7 @@
  65.     Unix SMB/Netbios implementation.
  66.     Version 1.9.
  67.     Tar Extensions
  68. -   Copyright (C) Ricky Poulton 1995
  69. +   Copyright (C) Ricky Poulten 1995
  70.     
  71.     This program is free software; you can redistribute it and/or modify
  72.     it under the terms of the GNU General Public License as published by
  73. @@ -799,13 +799,13 @@
  74.     * in that many fields, though
  75.     */
  76.  
  77. -/* check the checksum */
  78. +  /* check the checksum */
  79.    for (chk=0, i=sizeof(hb->dummy), jp=hb->dummy; --i>=0;) chk+=(0xFF & *jp++);
  80.  
  81.    if (chk == 0)
  82.      return chk;
  83.  
  84. -/* compensate for blanks in chksum header */
  85. +  /* compensate for blanks in chksum header */
  86.    for (i=sizeof(hb->dbuf.chksum), jp=hb->dbuf.chksum; --i>=0;)
  87.      chk-=(0xFF & *jp++);
  88.  
  89. @@ -814,7 +814,7 @@
  90.    fchk=unoct(hb->dbuf.chksum, sizeof(hb->dbuf.chksum));
  91.  
  92.    DEBUG(5, ("checksum totals chk=%d fchk=%d chksum=%s\n",
  93. -        chk, fchk, hb->dbuf.size));
  94. +        chk, fchk, hb->dbuf.chksum));
  95.  
  96.    if (fchk != chk)
  97.      {
  98. @@ -829,13 +829,17 @@
  99.             strlen(hb->dbuf.name) + 1);
  100.  
  101.  /* can't handle links at present */
  102. -  if (hb->dbuf.linkflag != '0')
  103. -    {
  104. -      DEBUG(0, ("this tar file appears to contain some kind of link\n"));
  105. +  if (hb->dbuf.linkflag != '0') {
  106. +    if (hb->dbuf.linkflag == 0) {
  107. +      DEBUG(4, ("Warning: NULL link detected %s\n", finfo->name));
  108. +    } else { 
  109. +      DEBUG(0, ("this tar file appears to contain some kind of link - ignoring\n"));
  110.        return -2;
  111.      }
  112. -
  113. -  if (unoct(hb->dbuf.mode, sizeof(hb->dbuf.mode)) & S_IFDIR)
  114. +  }
  115. +    
  116. +  if ((unoct(hb->dbuf.mode, sizeof(hb->dbuf.mode)) & S_IFDIR)
  117. +    || (*(finfo->name+strlen(finfo->name)-1) == '\\'))
  118.      {
  119.        finfo->mode=aDIR;
  120.      }
  121. @@ -896,7 +900,9 @@
  122.    while (--ndgs)
  123.      {
  124.        if (isdigit(*p))
  125. -    value = (value << 3) | (long) (*p++ - '0');
  126. +        value = (value << 3) | (long) (*p - '0');
  127. +
  128. +      p++;
  129.      }
  130.  
  131.    return value;
  132. diff -u -r --new-file last-version/source/dir.c samba-1.9.14alpha19/source/dir.c
  133. --- last-version/source/dir.c    Sat Sep 16 11:48:22 1995
  134. +++ samba-1.9.14alpha19/source/dir.c    Sat Sep 16 18:59:37 1995
  135. @@ -622,7 +622,7 @@
  136.    if (entry->next) entry->next->prev = entry;
  137.    dir_cache = entry;
  138.  
  139. -  DEBUG(1,("Added dir cache entry %s %s -> %s\n",path,name,dname));
  140. +  DEBUG(4,("Added dir cache entry %s %s -> %s\n",path,name,dname));
  141.    
  142.    if (dir_cache_size == DIRCACHESIZE) {
  143.      for (entry=dir_cache; entry->next; entry=entry->next) ;
  144. @@ -648,7 +648,7 @@
  145.      if (entry->snum == snum &&
  146.      strcmp(path,entry->path) == 0 &&
  147.      strcmp(name,entry->name) == 0) {
  148. -      DEBUG(1,("Got dir cache hit on %s %s -> %s\n",path,name,entry->dname));
  149. +      DEBUG(4,("Got dir cache hit on %s %s -> %s\n",path,name,entry->dname));
  150.        return(entry->dname);
  151.      }
  152.    }
  153. diff -u -r --new-file last-version/source/includes.h samba-1.9.14alpha19/source/includes.h
  154. --- last-version/source/includes.h    Fri Sep 15 20:28:21 1995
  155. +++ samba-1.9.14alpha19/source/includes.h    Wed Sep 20 01:21:06 1995
  156. @@ -675,16 +675,26 @@
  157.  #include <dirent.h>
  158.  #include <string.h>
  159.  #include <sys/vfs.h>
  160. -#include <netinet/in.h>
  161. -#include <errno.h>
  162. -#include <sys/wait.h>
  163. -#include <signal.h>
  164.  #include <fcntl.h>
  165.  #define DONT_REINSTALL_SIG
  166.  #define USE_SIGBLOCK
  167.  #define USE_WAITPID
  168.  #define SIGNAL_CAST (_SigFunc_Ptr_t)
  169.  #define NO_GETSPNAM
  170. +#define HAVE_MEMMOVE
  171. +extern char *mktemp(char *);
  172. +extern int  fsync(int);
  173. +extern int  seteuid(uid_t);
  174. +extern int  setgroups(int, int *);
  175. +extern int  initgroups(char *, int);
  176. +extern int  statfs(char *, struct statfs *);
  177. +extern int  setegid(gid_t);
  178. +extern int  getopt(int, char *const *, const char *);
  179. +extern int  chroot(char *);
  180. +extern int  gettimeofday(struct timeval *, struct timezone *);
  181. +extern int  gethostname(char *, int);
  182. +extern char *crypt(char *, char *);
  183. +extern char *getpass(char *);
  184.  #endif
  185.  
  186.  
  187. diff -u -r --new-file last-version/source/ipc.c samba-1.9.14alpha19/source/ipc.c
  188. --- last-version/source/ipc.c    Fri Sep 15 18:18:44 1995
  189. +++ samba-1.9.14alpha19/source/ipc.c    Wed Sep 20 01:26:25 1995
  190. @@ -791,7 +791,7 @@
  191.    if (uLevel > 1)
  192.      {
  193.        SSVAL(p,20,ACCESS_READ|ACCESS_WRITE|ACCESS_CREATE); /* permissions */
  194. -      SSVAL(p,22,-1);        /* max uses */
  195. +      SSVALS(p,22,-1);        /* max uses */
  196.        SSVAL(p,24,1); /* current uses */
  197.        SIVAL(p,26,PTR_DIFF(p2,baseaddr)); /* local pathname */
  198.        len += CopyAndAdvance(&p2,lp_pathname(snum),&l2);
  199. @@ -953,7 +953,7 @@
  200.      CVAL(p,9) = t->tm_min;
  201.      CVAL(p,10) = t->tm_sec;
  202.      CVAL(p,11) = 0;        /* hundredths of seconds */
  203. -    SSVAL(p,12,TimeDiff(0)/60); /* timezone in minutes from GMT */
  204. +    SSVALS(p,12,TimeDiff(0)/60); /* timezone in minutes from GMT */
  205.      SSVAL(p,14,10000);        /* timer interval in 0.0001 of sec */
  206.      CVAL(p,16) = t->tm_mday;
  207.      CVAL(p,17) = t->tm_mon + 1;
  208. @@ -1477,15 +1477,15 @@
  209.        p2 = skip_string(p2,1);
  210.        SIVAL(p,52,0);        /* last logon */
  211.        SIVAL(p,56,0);        /* last logoff */
  212. -      SSVAL(p,60,-1);        /* bad pw counts */
  213. -      SSVAL(p,62,-1);        /* num logons */
  214. +      SSVALS(p,60,-1);        /* bad pw counts */
  215. +      SSVALS(p,62,-1);        /* num logons */
  216.        SIVAL(p,64,PTR_DIFF(p2,*rdata)); /* logon server */
  217.        strcpy(p2,"\\\\GIGA");
  218.        p2 = skip_string(p2,1);
  219.        SSVAL(p,68,49);        /* country code */
  220.        SIVAL(p,70,0);        /* workstations */
  221.  
  222. -      SIVAL(p,74,-1L);        /* max storage */
  223. +      SIVALS(p,74,-1);        /* max storage */
  224.        SSVAL(p,78,168);        /* units per week */
  225.        SIVAL(p,80,PTR_DIFF(p2,*rdata)); /* logon hours */
  226.        memset(p2,-1,21);
  227. @@ -1494,7 +1494,7 @@
  228.      }
  229.      if (uLevel == 1 || uLevel == 2) {
  230.        memset(p+22,' ',16);    /* password */
  231. -      SIVAL(p,38,-1);        /* password age */
  232. +      SIVALS(p,38,-1);        /* password age */
  233.        SSVAL(p,42,USER_PRIV_ADMIN); /* user privilege */
  234.        SIVAL(p,44,PTR_DIFF(p2,*rdata)); /* home dir */
  235.        strcpy(p2,"\\\\__SAMBA__\\HOMES");
  236. @@ -1515,14 +1515,14 @@
  237.      SIVAL(p,76,0);        /* workstations */
  238.      SIVAL(p,80,0);        /* last_logon */
  239.      SIVAL(p,84,0);        /* last_logoff */
  240. -    SIVAL(p,88,-1);        /* acct_expires */
  241. -    SIVAL(p,92,-1);        /* max_storage */
  242. +    SIVALS(p,88,-1);        /* acct_expires */
  243. +    SIVALS(p,92,-1);        /* max_storage */
  244.      SSVAL(p,96,168);    /* units_per_week */
  245.      SIVAL(p,98,PTR_DIFF(p2,*rdata)); /* logon_hours */
  246.      memset(p2,-1,21);
  247.      p2 += 21;
  248. -    SSVAL(p,102,-1);    /* bad_pw_count */
  249. -    SSVAL(p,104,-1);    /* num_logons */
  250. +    SSVALS(p,102,-1);    /* bad_pw_count */
  251. +    SSVALS(p,104,-1);    /* num_logons */
  252.      SIVAL(p,106,PTR_DIFF(p2,*rdata)); /* logon_server */
  253.      strcpy(p2,"\\\\__SAMBA__");
  254.      p2 = skip_string(p2,1);
  255. diff -u -r --new-file last-version/source/loadparm.c samba-1.9.14alpha19/source/loadparm.c
  256. --- last-version/source/loadparm.c    Fri Sep 15 17:58:05 1995
  257. +++ samba-1.9.14alpha19/source/loadparm.c    Sun Sep 17 09:53:17 1995
  258. @@ -837,6 +837,14 @@
  259.    return(True);
  260.  }
  261.  
  262. +/***************************************************************************
  263. +add a new service, based on an old one
  264. +***************************************************************************/
  265. +int lp_add_service(char *pszService, int iDefaultService)
  266. +{
  267. +  return(add_a_service(pSERVICE(iDefaultService),pszService));
  268. +}
  269. +
  270.  
  271.  /***************************************************************************
  272.  add the IPC service
  273. diff -u -r --new-file last-version/source/loadparm.h samba-1.9.14alpha19/source/loadparm.h
  274. --- last-version/source/loadparm.h    Fri Sep 15 17:58:30 1995
  275. +++ samba-1.9.14alpha19/source/loadparm.h    Sun Sep 17 09:53:27 1995
  276. @@ -132,6 +132,7 @@
  277.  extern int  lp_servicenumber(char *pszServiceName);
  278.  extern BOOL lp_add_home(char *pszHomename, 
  279.                          int iDefaultService, char *pszHomedir);
  280. +extern int lp_add_service(char *service, int iDefaultService);
  281.  extern BOOL lp_add_printer(char *pszPrintername, int iDefaultService);
  282.  extern BOOL lp_readonly(int iService);
  283.  extern int lp_create_mode(int iService);
  284. diff -u -r --new-file last-version/source/password.c samba-1.9.14alpha19/source/password.c
  285. --- last-version/source/password.c    Sat Sep 16 12:02:07 1995
  286. +++ samba-1.9.14alpha19/source/password.c    Tue Sep 19 14:48:12 1995
  287. @@ -92,7 +92,7 @@
  288.  user_struct *get_valid_user_struct(int uid)
  289.  {
  290.    int vuid = valid_uid(uid);
  291. -  if(vuid == -1)
  292. +  if(vuid == -1 || validated_users[vuid].guest)
  293.      return NULL;
  294.    return &validated_users[vuid];
  295.  }
  296. diff -u -r --new-file last-version/source/server.c samba-1.9.14alpha19/source/server.c
  297. --- last-version/source/server.c    Sat Sep 16 11:35:14 1995
  298. +++ samba-1.9.14alpha19/source/server.c    Tue Sep 19 14:46:56 1995
  299. @@ -888,8 +888,10 @@
  300.    if (Connections[cnum].printer)
  301.      flags |= O_CREAT;
  302.  
  303. +/*
  304.    if (flags == O_WRONLY)
  305.      DEBUG(3,("Bug in client? Set O_WRONLY without O_CREAT\n"));
  306. +*/
  307.  
  308.  #if UTIME_WORKAROUND
  309.    /* XXXX - is this OK?? */
  310. @@ -1638,7 +1640,8 @@
  311.       }
  312.    else
  313.      {
  314. -      uid = Connections[cnum].uid; /* Set this so done_become_user is set correctly */
  315. +      uid = Connections[cnum].uid; /* Set this so done_become_user 
  316. +                      is set correctly */
  317.  
  318.        if (initial_uid == 0)
  319.          {
  320. @@ -1650,7 +1653,8 @@
  321.        {
  322.          /* groups stuff added by ih/wreu */
  323.          if (Connections[cnum].ngroups > 0)
  324. -          if (setgroups(Connections[cnum].ngroups,(GID_TYPE *)Connections[cnum].groups)<0)
  325. +          if (setgroups(Connections[cnum].ngroups,
  326. +                (GID_TYPE *)Connections[cnum].groups)<0)
  327.              DEBUG(0,("setgroups call failed!\n"));
  328.        }
  329.  #endif
  330. @@ -1730,6 +1734,8 @@
  331.  {
  332.     int iService;
  333.  
  334. +   string_sub(service,"\\","/");
  335. +
  336.     iService = lp_servicenumber(service);
  337.  
  338.     /* now handle the special case of a home directory */
  339. @@ -1778,8 +1784,13 @@
  340.     if (iService < 0) 
  341.       {
  342.         char *defservice = lp_defaultservice();
  343. -       if (defservice && *defservice && !strequal(defservice,service))
  344. -     return(find_service(defservice));
  345. +       if (defservice && *defservice && !strequal(defservice,service)) {
  346. +     iService = find_service(defservice);
  347. +     if (iService >= 0) {
  348. +       string_sub(service,"_","/");
  349. +       iService = lp_add_service(service,iService);
  350. +     }
  351. +       }
  352.       }
  353.  
  354.     if (iService >= 0)
  355. @@ -2329,8 +2340,9 @@
  356.      }
  357.      }
  358.  
  359. -  if (!lp_snum_ok(snum) || !check_access(snum))
  360. +  if (!lp_snum_ok(snum) || !check_access(snum)) {    
  361.      return(-4);
  362. +  }
  363.  
  364.    /* you can only connect to the IPC$ service as an ipc device */
  365.    if (strequal(service,"IPC$"))
  366. @@ -2346,8 +2358,10 @@
  367.  
  368.    /* if the request is as a printer and you can't print then refuse */
  369.    strupper(dev);
  370. -  if (!lp_print_ok(snum) && (strncmp(dev,"LPT",3) == 0))
  371. +  if (!lp_print_ok(snum) && (strncmp(dev,"LPT",3) == 0)) {
  372. +    DEBUG(1,("Attempt to connect to non-printer as a printer\n"));
  373.      return(-6);
  374. +  }
  375.  
  376.    /* lowercase the user name */
  377.    strlower(user);
  378. @@ -3181,7 +3195,7 @@
  379.    {
  380.      struct rlimit rlp;
  381.      getrlimit(RLIMIT_CORE, &rlp);
  382. -    rlp.rlim_cur = MAX(2*1024*1024,rlp.rlim_cur);
  383. +    rlp.rlim_cur = MAX(4*1024*1024,rlp.rlim_cur);
  384.      setrlimit(RLIMIT_CORE, &rlp);
  385.      getrlimit(RLIMIT_CORE, &rlp);
  386.      DEBUG(0,("Core limits now %d %d\n",rlp.rlim_cur,rlp.rlim_max));
  387. @@ -3202,6 +3216,7 @@
  388.    int i;
  389.    if (done_become_user != -1)
  390.      unbecome_user();
  391. +  DEBUG(1,("Closing connections\n"));
  392.    for (i=0;i<MAX_CONNECTIONS;i++)
  393.      if (Connections[i].open)
  394.        close_cnum(i,-1);
  395. diff -u -r --new-file last-version/source/util.c samba-1.9.14alpha19/source/util.c
  396. --- last-version/source/util.c    Fri Sep 15 21:06:29 1995
  397. +++ samba-1.9.14alpha19/source/util.c    Wed Sep 20 01:23:04 1995
  398. @@ -590,7 +590,6 @@
  399.  ****************************************************************************/
  400.  void close_sockets(void )
  401.  {
  402. -  extern int Client;
  403.    close(Client);
  404.    Client = 0;
  405.  }
  406. @@ -1347,7 +1346,6 @@
  407.  ********************************************************************/
  408.  char *GetWd(char *str)
  409.  {
  410. -  extern BOOL use_getwd_cache;
  411.    pstring s;
  412.    static BOOL getwd_cache_init = False;
  413.    struct stat st, st2;
  414. diff -u -r --new-file last-version/source/version.h samba-1.9.14alpha19/source/version.h
  415. --- last-version/source/version.h    Sat Sep 16 12:18:11 1995
  416. +++ samba-1.9.14alpha19/source/version.h    Wed Sep 20 01:46:17 1995
  417. @@ -1 +1 @@
  418. -#define VERSION "1.9.14alpha18"
  419. +#define VERSION "1.9.14alpha19"
  420.